package B_FactoryMode.FactoryMode;

/**
 * Created by zc on 2017/3/11.
 */
public class Test {
    public static void main(String[] args) {
//        HairInterface left = new LeftHair();
//        left.draw();
        HairFactory hairFactory = new HairFactory();
        HairInterface hair = hairFactory.getHair("left");
        if (hair != null) {
            hair.draw();
        }

        /**
         * 注意 传入类的全路径名
         */
        HairInterface rightHair = hairFactory.getHairByClass("B_FactoryMode.FactoryMode.RightHair");
        rightHair.draw();

        HairInterface left = hairFactory.getHairByClassKey("left");
        left.draw();
    }
}
